﻿using Azure.Core;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SY.BasicData.Api.Read.Applications.Basic.Command;
using SY.BasicData.Api.Read.Applications.Cultivation.Command;
using SY.BasicData.Domain.Cultivation;
using SY.BasicData.ErrorCode;

namespace SY.BasicData.Api.Read.Controllers.Cultivation
{
    /// <summary>
    /// 养殖信息
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]

    public class CultivationController : ControllerBase
    {
        private readonly IMediator mediator;
        private readonly ILogger<CultivationController> logger;

        public CultivationController(IMediator mediator, ILogger<CultivationController> logger)
        {
            this.mediator = mediator;
            this.logger = logger;
        }
        /// <summary>
        /// 养殖明细
        /// </summary>
        /// <param name="request">命令</param>
        /// <returns>返回结果</returns>
        [HttpGet]
        public Task<ApiResult<CultivationModel>> GetCultivation([FromQuery] GetCultivationQueryCommand request)
        {
            return mediator.Send(request);
        }
        /// <summary>
        /// 养殖免疫信息明细
        /// </summary>
        /// <param name="command">命令</param>
        /// <returns>返回结果</returns>
        /// 
        [HttpGet]
        public Task<ApiResult<ImmunityModel>> ImmunityDetail([FromQuery] ImmunityDetailCommand command)
        {
            return mediator.Send(command);

        }
        /// <summary>
        /// 养殖企业信息明细
        /// </summary>
        /// <param name="command">命令</param>
        /// <returns>返回结果</returns>
        /// 
        [HttpGet]
        public Task<ApiResult<CultivationCommpanyModel>> CultivationCommpanyDeatil([FromQuery] CultivationCommpanyDeatilCommand command)
        {
            return mediator.Send(command);

        }
    }
}
